import {
  createRouter, //创建路由实例
  createWebHashHistory, // hash模式
  createWebHistory, //html5模式
} from "vue-router";

const routes = [
  {
    path:"/",
    redirect:"/shangpin"
  },
  {
      path: "/shangpin",
      // name: "shangpin",
      component: () => import("../components/Shop/shangpin.vue"),
      children: [
        {
          path: "son",
          component:()=>import("../components/Shop/shangPinDetail.vue"),
        },
      ],
    },
  {
    path: "/pingjia",
    name: "pingjia",
    component: () => import("../components/Shop/pingjia.vue")
  },
  {
    path: "/shangjia",
    name: "shangjia",
    component: () => import("../components/Shop/shangjia.vue")
  },
    {
      path:"/shangPinDetail",
      component:()=>import("../components/Shop/shangPinDetail.vue"),
    },
    // {
    //   path:"/hotDetail",
    //   component:()=>import("../HotSpotDetail.vue"),
    // }
];

export default createRouter({
  history: createWebHistory(),
  routes,
});
